// 重构,请求返回的车险订单数据
import loop from '@/utils/loop'
import carOrderAPI from '@/components/ivew_conf/car_order_API'

export default (ctx, next) =>{
    
    let orderData = ctx.params;
    
    // 构建数据模板
    let template = loop.reverseBuild(carOrderAPI);
    
    // 提取所需数据
    let params = loop.assignment(orderData, template, loop.reverseMap(carOrderAPI) ,true)

    ctx.params = {
        ...params.data
    };

    next()
}